This presentation used various methods of Bivariate Analysis to infer relationship between various features of Nations.
log of GDP per capita: Logarithm (base e) of Gross Domestic Product (in $) per citizen. Adjusted for Inflation. [lngdp]
The Gross Domestic Product per capita of a country basically tells about the wealth of the citizens of the country.
Sanitation Access %: Percentage of people using at least basic Sanitation facilities, not shared with other households. [snt]
Sanitation of oneself is one of the basic tasks of a human being. We know poor sanitation is linked to transmission of diarrheal diseases such as cholera and dysentery, as well as typhoid, intestinal worm infections and polio which directly affect the health of an individual.
Life Expectancy: The average number of years a newly born child would live, provided current mortality patterns hold. [lfx]
Life expectancy is calculated based on the assumption that probability of death at a certain age stays constant in future. Hence we Life Expectation as a measurable proxy for Health.
Notice that mode of Sanitation is 100. Thus a large number of countries have universal access to basic sanitation infrastructure.
Measures of Dispersion
Range\operatorname{range}(x), Semi-Interquartile Range\operatorname{SIR}(x), Mean Deviation about x’\operatorname{MD}_{(x')}(x), Variances_x^2, Standard Deviations_x are some measures of dispersion in the sample.
ln(GDP) is nearly symmetrical, while Sanitation and Life Exp. are highly left-skewed.
This indicates majority of countries have good sanitation system and citizen health.
ln(GDP) and Sanitation are platykurtic, while Life Exp. is leptokurtic.
Density Plot
Code
labelfunction =as_labeller(c(`lngdp`="log of GDP per capita",`snt`="Sanitation Access %",`lfx`="Life Expectancy" ))ggplot(stack(d[2:4]), mapping =aes(x = values))+geom_density(aes(color=ind), linewidth=rel(1.5))+labs(x=NULL,y=NULL )+mytheme+mycolor+facet_wrap(~ind, scales="free", labeller = labelfunction, ncol=1)+theme(legend.position="none",strip.text.x =element_text(size =rel(1.5)) )
The density of the log of GDP per capita is symmetric as inferred previously. The other two density plots appear left skewed as supported by the negative skewness.
Box Plot
Box plots help us detect potential outliers. They also help us in estimating location and skewness of the distribution.
We observe one potential outlier in the Life Expectancy dataset. It is Haiti at 32.5 years. It is due to a cholera outbreak and an earthquake increasing the mortality rate in the nation in 2010.
Scatter Plot
A Scatter plot helps us estimate the type of relationship between variables.
sctrplot(d, d$lngdp, d$snt, "log of GDP per capita", "Sanitation Access %")
We observe from the scatter plot that the correlation between ln(GDP) and sanitation access appears to be mostly Linear for countries with low ln(GDP).
Also, the sanitation access is very close to 100% for countries with high ln(GDP).
Life Expectancy vs. log of GDP
Code
sctrplot(d, d$lngdp, d$lfx, "log of GDP per capita", "Life Expectancy")
We can see that except for some countries with very low life expectancies, the correlation between the variables is appearing to be linear.
We can see that the correlation appears to be linear between life expectation and sanitation. We also observe that there is clustering around the top right side of the plot, which is supported by the box plots of both the distributions.
Inferences
We observe a fairly strong positive Linear Correlation between the three features in the Scatter Plot.
We subsequently compute the Correlation Coefficients to quantify the Linear Correlation.
Bivariate Statistics
Correlation Coefficients
Correlation is any relationship, causal or spurious, between two random variables x, y.
Pearson’sr, Spearman’sr_s, and Kendall’s\tau are some correlation coefficients. These estimate the linear correlation between two variables.
We observe fairly good Linear Correlation of around 0.8 between all three variables. Thus a slight increase in ln(GDP), Sanitation or Life expectancy tends to accompany rise in the other two features increasing too.
Let us try to create a Linear Model to best estimate the relationship between the three variables.
Regression
Simple Linear Regression
Simple Univariate Linear Regression is a method for estimating the relationship y_i=f(x_i) of a response variable y with a predictor variable x, as a line that closely fits the y vs. xscatter plot.
y_i = \hat{a} + \hat{b} x_i + e_i
Where \hat{a} is the intercept, \hat{b} is the slope, and e_i is the ith residual error. We aim to minimize e_i for better fit.
Ordinary Least Squares
Ordinary Least squares method reduces e_i by minimizing error sum of squares\sum{{e_i}^2}.
Coefficient of DeterminationR^2 is the proportion of the variation in y predictable by the model.
p-value of an estimated coefficient denotes the reliability of the estimate.
Both OLS and LAD models fit the scatter plots very well. The OLS model is affected in the Life Expectancy plots due to the existence of Haiti as an outlier.
Our aim is to deduce which features more directly affect the Life Expectancy. Thus we should remove the effect of the other features when computing correlation.
Partial Correlation
Partial Correlation is the relationship between two variables x, y of interest, after removing effect of some other related variable z.
How the years’ life expectancies and an year’s GDP correlate with.
How the years’ life expectancies and an year’s Sanitation correlate with.
How an year’s life expectancies correlate with the years’ GDP.
How an year’s life expectancies correlate with the years’ Sanitation.
Thus our analysis is fairly robust with respect to variation in Time. Thus we only perform the analysis on the year 2010.
Raw GDP per capita
Sanitation vs GDP per capita
Code
sctrplot(d, exp(d$lngdp), d$snt, "GDP per capita", "Sanitation Access %")
Life Expectancy vs GDP per capita
Code
sctrplot(d, exp(d$lngdp), d$lfx, "GDP per capita", "Sanitation Access %")
Scatter Plots of Sanitation or Life Exp. with respect to raw GDP are not linearly correlated. As this was beyond our scope of knowledge, we instead considered the log (base e) of GDP.
Thus in reality, rise in GDP provides diminishing returns in citizen health the wealthier a country is.
Conclusion
Thus we have observed that Life expectancy increases with rise in log of GDP per capita and Sanitation facility access. Life Expectancy is also more directly affected by increase in basic Sanitation access than with rise in log of GDP per capita.
Suggestions
Governments should consider that:
Focusing on better sanitation services leads to visibly better lifespan of the citizens.
Improvements in GDP per capita make practical improvements in sanitation and life expectancy only for poorer countries, due diminishing returns in the log scale.
Improvements to life expectancies once made, are fairly stable.
Notable Countries
Some countries had alarmingly low Life Expectancies:
The countries like the Central African Republic, Zimbabwe have very low life expectancies due to endemic poverty and weak governance, contributing to a dire health situation.
Haiti had a high child mortality rate in 2010 due to natural disasters and cholera outbreaks. This caused low Life expectancy for that year.
Countries like Mozambique, Lesotho are experiencing increasing double burden of diseases characterized by an increase in the burden of non-communicable diseases as well as a high burden of communicable diseases.
Also countries like Eswatini, Zambia also have a low life expectancy due to the outbreak of HIV.